package com.siteseat.crudeq.broker.netty;

import com.siteseat.crudeq.broker.transport.BrokerSession;
import com.siteseat.crudeq.broker.transport.BrokerSessionFactory;
import com.siteseat.common.foundation.Component;
import com.siteseat.common.security.SecurityManager;
import com.siteseat.crudeq.kernel.QueueManager;
import org.jboss.netty.channel.Channel;

/**
 *
 */
public class NettySessionFactory extends Component implements BrokerSessionFactory {

  /**
   * {@inheritDoc}
   */
  @Override
  public BrokerSession create( Object transportObject, SecurityManager authenticator, QueueManager queueManager ) {
    return new NettyBrokerSession( (Channel)transportObject, authenticator, queueManager );
  }

  /**
   * {@inheritDoc}
   */
  @Override
  protected void doInit() throws Exception {
    // do nothing so far
  }

  /**
   * {@inheritDoc}
   */
  @Override
  protected void doDestroy() throws Exception {
    // do nothing so far
  }

}
